<%--
  Created by IntelliJ IDEA.
  User: qiwenyong
  Date: 2024/11/27
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/alert.min.js"></script>
    <script>
        //    $('.alert').on('click', function () {
        //      $.alert('成功');
        //    });
        $(function(){

            $('.del').on('click', function () {
                $.confirm('确认要删除吗？', function (isConfirm) {
                    if (isConfirm) {
                        $.alert('确认');
                    } else {
                        $.alert('取消');
                    }
                });
            });

        });

    </script>
</head>
<body>

<div style="padding:0px; margin:0px;">
    <ul class="breadcrumb" style="  margin:0px; " >
        <li><a href="#">商品类型管理</a></li>
        <li>类型列表</li>
    </ul>
</div>
<div class="row alert alert-info" style="margin:5px 0px 5px 0px; padding:3px;">
    <form class="form-inline" action="category_list.html">
        <div class="form-group">
            <input type="text" name="kw" class="form-control" id="activename" placeholder="请输入关键字">
        </div>
        <input type="submit" class="btn btn-danger" value="查询"/>
        <a class="btn btn-success" href="${pageContext.request.contextPath}/pages/category/save.jsp">增加</a>
    </form>
</div>
<div class="row" style="padding:15px; padding-top:0px; ">
    <table class="table  table-condensed table-striped">
        <tr>
            <th>类型编号</th>
            <th>类型名称</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${categoryList}" var="category" varStatus="stat">
        <tr>
            <td>${stat.count}</td>
            <td>${category.name}</td>
            <td>
                <a href="${pageContext.request.contextPath}/CategoryFindByIdServlet?id=${category.id}">
                    <span class="glyphicon glyphicon-edit" aria-hidden="true">修改</span>
                </a>
                <a href="${pageContext.request.contextPath}/CategoryDeleteByIdServlet?id=${category.id}">
                    <span class="glyphicon glyphicon-trash del" aria-hidden="true">删除</span>
                </a>
            </td>
        </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>
